<script setup lang="ts">
import { defaultShare } from '@/utils'
import LoadingPage from '@/components/LoadingPage.vue'
import Network_error from '@/components/Network_error.vue'
import TabBarPageContent from '@/components/TabBarPageContent.vue'

const loading = ref(true)
const routeParams = ref<any>()
onLoad(async (data: any) => {
  // uni.hideTabBar()
  routeParams.value = data
})

const init = async () => {
  console.log(routeParams.value, '扫码入口参数')
  const scene = decodeURIComponent(routeParams.value.scene)
  console.log(scene)
  setTimeout(() => {
    loading.value = false
  }, 200)
}

onShow(async () => {
  uni.login({
    success: (res) => {
      console.log(res, 'get wxcode')
    },
  })
})

onShareAppMessage(() => {
  return defaultShare()
})
</script>

<template>
  <!-- <Navbar title=" " :isback="false" bgcolor="transparent" transparent /> -->
  <TabBarPageContent bg="#F0F0F0" @init="init">
    <view class="bg-[#F0F0F0] h100%">
      home
    </view>
  </TabBarPageContent>

  <Network_error />
  <LoadingPage :loading="loading" @close="loading = false" />
</template>

<style lang="scss" scoped></style>
